package com.voa.web.interceptor;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import net.sf.ehcache.CacheManager;

import com.voa.constants.OASQLConstant;
import com.voa.constants.OAStringConstant;

public class ConstantsInitListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent arg0) {
		CacheManager.getInstance().clearAll();
		CacheManager.getInstance().shutdown();
		System.out.println("Cache clear & shutdown...");
	}

	public void contextInitialized(ServletContextEvent arg0) {
		new OASQLConstant();
		new OAStringConstant();
		System.out.println("OA Constants init success...");
	}

}
